Easiest way to get all links of a link module?

I'm quite stuck with getting the links here:

In our app we need to exchange whole link modules. So for me, the easiest way would be to take the desired link module, request all link sets, iterate over the links and print the object ids into a file.

I figured out, that i need to access the link module descriptor to get the link sets, but that doesn't seem to work if you are using the automatically generated link module. Is there a general way of how to get all links of a link module?

Thanks for the help,

Andreas.
SystemAdmin - Fri Sep 25 05:51:56 EDT 2009

Re: Easiest way to get all links of a link module?
llandale - Mon Sep 28 15:38:28 EDT 2009

This is like your other post. LMDs are not LinkSets.

If you are truly exchanging 'link module' you can simply move the existing link module to the new location and then rename it. The problem here is that the LMDs (LSPs) defined for each module are based on the link module name, not its ID. So before you do that you should iterate through all folders of the Project finding LMDs associated with that link module and be prepared to create new LMDs after its renamed. Its a bit of a bear.

If that's what you are doing, I'd: [1] Create the new link module in the final folder [2] loop through all folders of the project finding LMDs going to the old Link Module, gather that LMDs info, delete it, and create a new LMDs pointing to the new module. [3] Delete the newly created Link Module [4] move the old LM, and rename it.

  • Louie

Re: Easiest way to get all links of a link module?
SystemAdmin - Tue Sep 29 08:46:58 EDT 2009

llandale - Mon Sep 28 15:38:28 EDT 2009
This is like your other post. LMDs are not LinkSets.

If you are truly exchanging 'link module' you can simply move the existing link module to the new location and then rename it. The problem here is that the LMDs (LSPs) defined for each module are based on the link module name, not its ID. So before you do that you should iterate through all folders of the Project finding LMDs associated with that link module and be prepared to create new LMDs after its renamed. Its a bit of a bear.

If that's what you are doing, I'd: [1] Create the new link module in the final folder [2] loop through all folders of the project finding LMDs going to the old Link Module, gather that LMDs info, delete it, and create a new LMDs pointing to the new module. [3] Delete the newly created Link Module [4] move the old LM, and rename it.

  • Louie

Thanks for the answer,
but it wasn't my intention to move a link module within DOORS. What I actually want is to generate a text file that contains the links. I need that file, since we are using the links within our application and need to synchronize our links with the links in DOORS.

the file looks something like that (each line represents a link - from source to target):
/myFolder/Test_Cases#TC1, /myFolder/Software_Requirements#RQ1
/myFolder/Test_Cases#TC2, /myFolder/Software_Requirements#RQ3
/myFolder/Test_Cases#TC2, /myFolder/Software_Requirements#RQ4

I'm able to generate that file - BUT only if there is a link set configured in the (formal) source module. Yet the problem is, that you do NOT necessarily need to create a link set in the source module to be able to link objects (e.g. with the autom. generated link module).

The way I'm getting the links is that I search all LMDs of a folder, wich might not be correct for the situation described above (because there is no such LMD in the folder).

So is there a way to also get links for which there is NO link set defined in the formal source module BUT only in the link module instead?

Hope this isn't too confusing,
Andreas

Re: Easiest way to get all links of a link module?
SystemAdmin - Tue Sep 29 15:00:05 EDT 2009

SystemAdmin - Tue Sep 29 08:46:58 EDT 2009
Thanks for the answer,
but it wasn't my intention to move a link module within DOORS. What I actually want is to generate a text file that contains the links. I need that file, since we are using the links within our application and need to synchronize our links with the links in DOORS.

the file looks something like that (each line represents a link - from source to target):
/myFolder/Test_Cases#TC1, /myFolder/Software_Requirements#RQ1
/myFolder/Test_Cases#TC2, /myFolder/Software_Requirements#RQ3
/myFolder/Test_Cases#TC2, /myFolder/Software_Requirements#RQ4

I'm able to generate that file - BUT only if there is a link set configured in the (formal) source module. Yet the problem is, that you do NOT necessarily need to create a link set in the source module to be able to link objects (e.g. with the autom. generated link module).

The way I'm getting the links is that I search all LMDs of a folder, wich might not be correct for the situation described above (because there is no such LMD in the folder).

So is there a way to also get links for which there is NO link set defined in the formal source module BUT only in the link module instead?

Hope this isn't too confusing,
Andreas

From one point of view, without doing anything you have all the link contained in a link module. All the links count to 0.

A link module contains no links. Link modules contains linksets.

Re: Easiest way to get all links of a link module?
llandale - Tue Sep 29 15:13:01 EDT 2009

SystemAdmin - Tue Sep 29 08:46:58 EDT 2009
Thanks for the answer,
but it wasn't my intention to move a link module within DOORS. What I actually want is to generate a text file that contains the links. I need that file, since we are using the links within our application and need to synchronize our links with the links in DOORS.

the file looks something like that (each line represents a link - from source to target):
/myFolder/Test_Cases#TC1, /myFolder/Software_Requirements#RQ1
/myFolder/Test_Cases#TC2, /myFolder/Software_Requirements#RQ3
/myFolder/Test_Cases#TC2, /myFolder/Software_Requirements#RQ4

I'm able to generate that file - BUT only if there is a link set configured in the (formal) source module. Yet the problem is, that you do NOT necessarily need to create a link set in the source module to be able to link objects (e.g. with the autom. generated link module).

The way I'm getting the links is that I search all LMDs of a folder, wich might not be correct for the situation described above (because there is no such LMD in the folder).

So is there a way to also get links for which there is NO link set defined in the formal source module BUT only in the link module instead?

Hope this isn't too confusing,
Andreas

OK, forget about the LSPs/LMDs.

Usually folks get all the links From a particular Source, or TO a particular Target module. You seem to be asking for all the links associated with a particular link module.

Do something like this:

Module mLink = read(NameLinkModFull, false)
for oLink in entire mLink do
{         // Each 'Object' in a link module is a 'LinkSet'.
   NameSourceFull = obj."Source"
   NameTargetFull = obj."Target"
 
   mSource = read(NameSourceFull, false)
   mTarget = read(NameTargetFull, false)
   for oSource in entire mSource do
   {  if (isDeleted(oSource)) continue
      for lnk in oSource -> NameLinkModFull do
      {  NameTargetLink = fullName(target(lnk))
         if (NameTargetLink == NameTargetFull)
         {  // ** found a link, record it
         }
      }
   }
   close(mSource)
   close(mTarget)
 }   // end for linksets

 

 

  • Louie

 

 

Re: Easiest way to get all links of a link module?
SystemAdmin - Wed Sep 30 07:16:05 EDT 2009

llandale - Tue Sep 29 15:13:01 EDT 2009

OK, forget about the LSPs/LMDs.

Usually folks get all the links From a particular Source, or TO a particular Target module. You seem to be asking for all the links associated with a particular link module.

Do something like this:

Module mLink = read(NameLinkModFull, false)
for oLink in entire mLink do
{         // Each 'Object' in a link module is a 'LinkSet'.
   NameSourceFull = obj."Source"
   NameTargetFull = obj."Target"
 
   mSource = read(NameSourceFull, false)
   mTarget = read(NameTargetFull, false)
   for oSource in entire mSource do
   {  if (isDeleted(oSource)) continue
      for lnk in oSource -> NameLinkModFull do
      {  NameTargetLink = fullName(target(lnk))
         if (NameTargetLink == NameTargetFull)
         {  // ** found a link, record it
         }
      }
   }
   close(mSource)
   close(mTarget)
 }   // end for linksets

 

 

  • Louie

 

 

Thanks a lot, that was exactly what I was looking for.